/**
 * ISysUserService.java
 * Created at 2016-12-26
 * Created by Tinel
 * Copyright (C) 2015 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.service;

import java.util.List;
import java.util.Map;

import com.broadtext.common.bean.EntityPageBean;
import com.broadtext.common.exp.DaoException;
import com.broadtext.common.exp.ServiceException;
import com.broadtext.common.service.IEntityService;
import com.broadtext.rms.system.model.SysAccountValidity;
import com.broadtext.rms.system.model.SysUser;
import com.broadtext.rms.system.model.VSysUsers;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;

/**
 * <p>
 * ClassName: ISysUserService
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Author: Tinel
 * </p>
 * <p>
 * Date: 2016-12-26
 * </p>
 */
public interface ISysUserService extends IEntityService<SysUser> {

    /**
     * 
     * <p>Description: 用户管理列表翻页查询</p>
     * @param map 查询条件
     * @param pageBounds 翻页信息
     * @return 查询结果
     * @throws ServiceException 异常
     */
    EntityPageBean<VSysUsers> findUsersPageByQuery(Map<String, Object> map, PageBounds pageBounds) throws ServiceException;

    /**
     * 
     * <p>Description: 取消用户绑定</p>
     * @param idArray 用户ID集合
     * @param sysUser 当前操作用户名
     * @return 取消结果
     * @throws ServiceException 异常
     */
    boolean cancelUserBind(String[] idArray, String sysUser) throws ServiceException;

    /**
     * 
     * <p>Description: 用户锁定</p>
     * @param idArray 用户ID集合
     * @param sysUser 当前操作用户名
     * @return 操作结果
     * @throws ServiceException 异常
     */
    boolean lockUser(String sysUser, String[] idArray) throws ServiceException;

    /**
     * 
     * <p>Description: 用户解除锁定</p>
     * @param idArray 用户ID集合
     * @param sysUser 当前操作用户名
     * @return 操作结果
     * @throws ServiceException 异常
     */
    boolean lockCancel(String sysUser, String[] idArray) throws ServiceException;

    /**
     * 
     * <p>Description: 查询用户绑定信息详情</p>
     * @param id 人员ID
     * @return 详情
     * @throws ServiceException 异常
     */
    VSysUsers getUserBindInfo(String id) throws ServiceException;
    
    /**
     * 
     * <p>Description: 查询用户账户期限信息</p>
     * @param id 人员ID
     * @return 详情
     * @throws ServiceException 异常
     */
    VSysUsers getAccountValidityInfo(String id) throws ServiceException;
    
    /**
     * 
     * <p>Description: 修改用户账户期限信息</p>
     * @param id 人员ID
     * @return 详情
     * @throws ServiceException 异常
     */
    Boolean updateAccountValidityByEId(SysAccountValidity account) throws ServiceException;
    
    /**
     * 
     * <p>Description: 保存用户账户期限信息</p>
     * @param id 人员ID
     * @return 详情
     * @throws ServiceException 异常
     */
    Boolean saveAccountValidityInfo(SysAccountValidity account) throws ServiceException;
    
    /**
     * 
     * <p>Description: update用户账户期限信息</p>
     * @param id 人员ID
     * @return 详情
     * @throws ServiceException 异常
     */
    Boolean updateAccountValidityInfo(SysAccountValidity account) throws ServiceException;

    /**
     * 
     * <p>Description: 检测登录名是否与已有数据冲突</p>
     * @param user 待检测用户信息
     * @return 结果
     * @throws ServiceException 异常
     */
    Boolean checkUserNameOk(SysUser user) throws ServiceException;

    /**
     * 
     * <p>Description: 查询当前未绑定用户数量</p>
     * @return 查询结果
     * @throws ServiceException 异常
     */
    long getUnbindCount(Map<String,Object> map) throws ServiceException;

    /**
     * 
     * <p>Description: 验证当前登录人账号类型</p>
     * @param userId 用户账号
     * @return 结果集
     * @throws DaoException 异常
     */
    Map<String, Object> checkUserClass(String userId) throws DaoException;
    
    /**
     * 
     * <p>Description: 验证当前登录人账号类型</p>
     * @param userId 用户账号
     * @return 结果集
     * @throws DaoException 异常
     */
    Map<String, Object> getUserClass(String loginName) throws DaoException;
    
    
    /**
     * 
     * <p>Description: 获取客户关系树结构</p>
     * @param rootId 用户账号
     * @return 结果集
     * @throws DaoException 异常
     */
    List<String> findTreeCusIds(String rootId) throws ServiceException;
    
    
    Map<String, Object> getQueryParams(String loginName);
    
    String getCustomerId(String loginName);
    
    
    List<Object> getRoleOptions(String isCustomer) throws ServiceException;
    
    boolean saveUserRole(String userId, String roleId) throws ServiceException;
    
    Map<String, Object> getCustomerRole() throws ServiceException;
}
